import request from './request'
import type { ApiResponse } from './types'

// report status
export type ReportStatus = 'draft' | 'in_progress' | 'completed'

// report data type
export interface ReportData {
  id: number
  name: string
  description: string
  department: number
  departmentIds: number[]
  status: ReportStatus
  progress: number
  kpiIds: number[]
  process: ProcessStep[]
  remark: string
  createTime: string
}

// 流程步骤数据类型
interface ProcessStep {
  name: string
  description: string
  handlers: number[]
  timeLimit: number
}

// 获取报表列表
export const getReportList = (params: {
  department?: number
}) => {
  return request({
    url: '/report/list',
    method: 'post',
    data: params
  })
}

// 报表状态
export const getReportStatus = () => {
  return request({
    url: '/report/status',
    method: 'get'
  })
}

// 绩效等级分布
export const getKpiScore = () => {
  return request({
    url: '/kpiFillDetails/getKpiScore',
    method: 'post',
    data: {}
  })
}
